home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM03_A.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  3KB  |  78 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM03_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_unalloc_page_count                                  ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the number of unallocated         ;
  7. ;                     expanded memory pages.                                  ;
  8. ;                                                                             ;
  9. ;           PASSED:   &unalloc_page_count:                                    ;
  10. ;                        is a far pointer to the unallocated page count.      ;
  11. ;                                                                             ;
  12. ;         RETURNED:   status:                                                 ;
  13. ;                        is the status EMM returns from the call.  All other  ;
  14. ;                        returned results are valid only if the status        ;
  15. ;                        returned is zero.  Otherwise they are undefined.     ;
  16. ;                                                                             ;
  17. ;                     unalloc_page_count:                                     ;
  18. ;                        is the number of expanded memory pages currently     ;
  19. ;                        available for use (unallocated).                     ;
  20. ;                                                                             ;
  21. ; C USE CONVENTION:   unsigned int status;                                    ;
  22. ;                     unsigned int unalloc_page_count;                        ;
  23. ;                                                                             ;
  24. ;                     status = get_unalloc_page_count (&unalloc_page_count);  ;
  25. ;-----------------------------------------------------------------------------;
  26. .XLIST
  27. PAGE    60,132
  28.  
  29. IFDEF SMALL
  30.    .MODEL SMALL, C
  31. ENDIF
  32. IFDEF MEDIUM
  33.    .MODEL MEDIUM, C
  34. ENDIF
  35. IFDEF LARGE
  36.    .MODEL LARGE, C
  37. ENDIF
  38. IFDEF COMPACT
  39.    .MODEL COMPACT, C
  40. ENDIF
  41. IFDEF HUGE
  42.    .MODEL HUGE, C
  43. ENDIF
  44.  
  45. INCLUDE emmlib.equ
  46. INCLUDE emmlib.str
  47. INCLUDE emmlib.mac
  48. .LIST
  49. .CODE
  50.  
  51. get_unalloc_page_count    PROC                                                  \
  52.             ptr_unalloc_page_count:FAR PTR WORD
  53.  
  54.     ;---------------------------------------------------------------------;
  55.     ;   do;                                                               ;
  56.     ;   .   get total & unallocated page counts from EMM;                 ;
  57.     ;---------------------------------------------------------------------;
  58.     MOVE        AH, get_unalloc_page_cnt_fcn
  59.     INT         EMM_int
  60.  
  61.     ;---------------------------------------------------------------------;
  62.     ;   .   pass unallocated page count back to the caller;               ;
  63.     ;---------------------------------------------------------------------;
  64.     MOVE        DX, BX
  65.     MOVE        ES:BX, ptr_unalloc_page_count
  66.     MOVE        ES:[BX], DX
  67.  
  68.     ;---------------------------------------------------------------------;
  69.     ;   .   return (EMM status);                                          ;
  70.     ;   end;                                                              ;
  71.     ;---------------------------------------------------------------------;
  72.     RET_EMM_STAT    AH
  73.  
  74. get_unalloc_page_count    ENDP
  75.  
  76. PAGE
  77. END
  78.